﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <DataTemplate x:Key="FeaturedMenuItem">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True">
            <StackPanel Width="173" >
                <Image Stretch="UniformToFill" Height="150" Width="150" Source="{Binding ImageUrl}" Margin="0" />
                <StackPanel Orientation="Horizontal" Width="173" Margin="0">
                    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,5" Width="173">
                        <TextBlock Text="{Binding Name}" TextWrapping="Wrap" Margin="5,0,0,0" FontFamily="Segoe WP Black" FontSize="18" Width="173" />
                        <TextBlock Text="{Binding UserName}" Margin="5,0,0,0" FontSize="18" Foreground="{StaticResource MyPhoneAccentBrush}" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </ListBoxItem>
        
    </DataTemplate>

    <DataTemplate x:Key="FeaturedMenuItem2">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True" Margin="0,0,0,10">
            <StackPanel Orientation="Horizontal" >
                <Image Stretch="UniformToFill" Height="100" Width="100" Source="{Binding ImageUrl}" Margin="0" />
                <StackPanel Orientation="Horizontal" Width="173" Margin="0">
                    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,5">
                        <TextBlock Text="{Binding Name}" TextWrapping="Wrap" Margin="5,0,-126,0" FontFamily="Segoe WP Black" Style="{StaticResource PhoneTextTitle2Style}" />
                        <TextBlock Text="{Binding UserName}" Margin="5,0,0,0" FontSize="18" Foreground="{StaticResource MyPhoneAccentBrush}" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </ListBoxItem>
    </DataTemplate>



    <DataTemplate x:Key="UpcomingMeetingsItem">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True" Margin="0,0,0,10">
            <StackPanel Orientation="Horizontal">
                <Rectangle Width="45" Height="90" Fill="{Binding Colour}" />
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
    		        <TextBlock TextWrapping="Wrap" 
                               Text="{Binding MeetingVenue.Town}" Margin="5,0,0,0" 
                               Foreground="{StaticResource MyPhoneForegroundBrush}" 
                               Style="{StaticResource MyPhoneTextLargeStyle}"/>
    		        <TextBlock TextWrapping="Wrap" 
                               FontFamily="{StaticResource PhoneFontFamilySemiBold}" 
                               FontWeight="Bold" Text=" - " 
                               Foreground="{StaticResource MyPhoneForegroundBrush}" 
                               Style="{StaticResource MyPhoneTextLargeStyle}" Margin="0"/>
    		        <TextBlock TextWrapping="Wrap" 
                               Text="{Binding Date}" 
                               Foreground="{StaticResource MyPhoneForegroundBrush}" 
                               Style="{StaticResource MyPhoneTextLargeStyle}" 
                               Margin="0"/>
    	        </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding MeetingVenue.Title}" Margin="5,0,0,0" Foreground="{Binding Colour, Mode=OneWay}" />
                        <TextBlock Foreground="{Binding Colour, Mode=OneWay}"><Run Text=","/></TextBlock>
                        <TextBlock Text="{Binding MeetingVenue.PostCode}" Foreground="{Binding Colour, Mode=OneWay}" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            
        </ListBoxItem>
        
    	
    </DataTemplate>
    
    <DataTemplate x:Key="AgendaListItem">
    	<StackPanel>
    		<StackPanel Orientation="Horizontal">
    			<TextBlock Text="{Binding Time}" Style="{StaticResource PhoneTextTitle3Style}" 
				Foreground="{StaticResource MyPhoneForegroundBrush}"/>
				<TextBlock Text="-" Style="{StaticResource PhoneTextTitle3Style}" 
				Foreground="{StaticResource MyPhoneForegroundBrush}"/>
            	<TextBlock Text="{Binding Title}" 
				Foreground="{StaticResource MyPhoneForegroundBrush}"
				Style="{StaticResource PhoneTextTitle3Style}"/>		
			</StackPanel>
    		
            <TextBlock 	Text="{Binding Description}" 
						TextWrapping="Wrap"
						Foreground="{StaticResource MyPhoneForegroundBrush}"
						Style="{StaticResource PhoneTextTitle3Style}"/>
    	</StackPanel>
    </DataTemplate>
  
    
    <DataTemplate x:Key="AppListItem">
            <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True" Width="440" Margin="-12,10,0,10" BorderThickness="0">
                <StackPanel Orientation="Horizontal" Width="432" >
                    <Image Stretch="UniformToFill" Height="80" Width="80" Source="{Binding ImageUrl}" Margin="0" VerticalAlignment="Top" />
                    <StackPanel Orientation="Horizontal" Margin="0" Width="351">
                        <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,5">
                            <TextBlock Text="{Binding Name, Converter={StaticResource UpperCaseConverter}}" 
                                       TextWrapping="Wrap" Margin="5,0,-178,0"
                                       Foreground="{StaticResource MyPhoneForegroundBrush}" 
                                       FontFamily="Segoe WP Black" FontSize="32" />
                            <TextBlock Text="{Binding UserName, Converter={StaticResource UpperCaseConverter}}" 
                                       Margin="5,0,-178,0" FontSize="18" Foreground="{StaticResource MyPhoneAccentBrush}" 
                                       Style="{StaticResource PhoneTextTitle3Style}" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </ListBoxItem>
    </DataTemplate>

    <DataTemplate x:Key="GroupHeader">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True">
            <StackPanel Width="400" HorizontalAlignment="Left">
                <Border Background="Transparent"
                BorderThickness="1"
                BorderBrush="{StaticResource MyPhoneAccentBrush}"
                >
                    <TextBlock Text="{Binding Title}" 
					Style="{StaticResource PhoneTextExtraLargeStyle}" 
                    Foreground="{StaticResource MyPhoneAccentBrush}"/>
                </Border>
            </StackPanel>
        </ListBoxItem>
    </DataTemplate>



    <DataTemplate x:Key="GroupItemHeader">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True" >
            <StackPanel >
                <Border Background="{StaticResource MyPhoneAccentBrush}" 
                Height="99" 
                Width="99" 
                Margin="6"
                toolkit:TiltEffect.IsTiltEnabled="True">
                    <TextBlock Text="{Binding Title}" Foreground="White" FontWeight="Bold" FontSize="42"/>
                </Border>
            </StackPanel>
        </ListBoxItem>
    </DataTemplate>

    <DataTemplate x:Key="LongGroupItemHeader">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True">
            <StackPanel >
                <Border Background="{StaticResource MyPhoneAccentBrush}" 
                Width="480"        
                Margin="6"
                toolkit:TiltEffect.IsTiltEnabled="True"
                >
                    <TextBlock Text="{Binding Title}" Foreground="White" FontWeight="Bold" FontSize="42"/>
                </Border>
            </StackPanel>
        </ListBoxItem>
    </DataTemplate>
    
    <DataTemplate x:Key="TwitterListItem">
    	<ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True" Margin="0,0,0,10" >
    		<StackPanel Orientation="Horizontal">
    		<Image Source="{Binding ImageSource}" Width="50" Height="50" VerticalAlignment="Top" />
			<StackPanel Width="440">
				<TextBlock Text="{Binding Username}" Style="{StaticResource PhoneTextLargeStyle}" 
				Foreground="{StaticResource MyPhoneForegroundBrush}" Margin="12,0,0,0" Width="420" />
                <TextBlock Text="{Binding Message}" 
                           Style="{StaticResource MyPhoneTextNormalStyle}" 
                           TextWrapping="Wrap" Margin="12,0,0,0" Width="420"  />
                <TextBlock Text="{Binding PublishedDate, Converter={StaticResource RelativeTimeConverter}}" Style="{StaticResource MyPhoneTextAccentStyle}" HorizontalAlignment="Right" Margin="0,0,11,0" />
                </StackPanel>
		</StackPanel>  	
		</ListBoxItem>
    	
    </DataTemplate>
	<DataTemplate x:Key="test">
		<Grid Width="440">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition />
				<RowDefinition />
				<RowDefinition  />
			</Grid.RowDefinitions>
			
			<Image Source="{Binding ImageSource}" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Width="50" 
				Height="50" VerticalAlignment="Top" />
			<TextBlock Text="{Binding Username}" Style="{StaticResource PhoneTextLargeStyle}" 
				Grid.Column="1" Grid.Row="0"
				Foreground="{StaticResource MyPhoneForegroundBrush}" Margin="12,0,0,0" d:LayoutOverrides="HorizontalMargin" />
			<TextBlock Text="{Binding Message}" 
				Grid.Column="1" Grid.Row="1"
				Style="{StaticResource MyPhoneTextNormalStyle}" 
				TextWrapping="Wrap" Margin="12,0,0,0" d:LayoutOverrides="HorizontalMargin"  />
			<TextBlock Text="{Binding PublishedDate, Converter={StaticResource RelativeTimeConverter}}" 
				Grid.Column="1" Grid.Row="2"
				Style="{StaticResource MyPhoneTextAccentStyle}" Margin="0,0,11,0" />
		</Grid>
	</DataTemplate>

    <DataTemplate x:Key="LinksItem">
        <ListBoxItem toolkit:TiltEffect.IsTiltEnabled="True">
            <StackPanel>
                <TextBlock Text="{Binding Name}" Foreground="{StaticResource MyPhoneForegroundBrush}" FontSize="26.667" FontFamily="Segoe WP Black" />
                <TextBlock Text="{Binding Description}" Foreground="{StaticResource MyPhoneForegroundBrush}" Style="{StaticResource MyPhoneTextAccentStyle}" />
            </StackPanel>
        </ListBoxItem>
    </DataTemplate>

</ResourceDictionary>